<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="http://cdn.bootcss.com/blueimp-md5/1.1.0/js/md5.js"></script>
</head>
<body>
<form id="form1" name="jjform" onsubmit="return f()" action="https://www.baidu.com/" method="post">
<span>用户名</span><input type="text" id="username" name="username"/><br>
<span>密码</span><input type="password" id="password" name="password"/><br>
    <button type="submit">提交</button>
</form>
<script>
    function f() {

        var ur = document.getElementById('username');
        var pwd =document.getElementById('password');
        pwd.value=md5(pwd);
        return true;
    }
</script>
</body>
</html>